Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOClassMapping
(informal protocol)

Category Of:	NSObject

Declared In:	eoaccess/EOGenericRecord.h

Category Description

The EOClassMapping protocol defines a class method that allows a class specified by a particular entity to substitute a different class based on it's fetched row or primary key values. The returned class must be either a subclass of the original class, have an entity specified in the model, or implement the entity method of the EOEntityMapping protocol. This requirement is not checked, but will cause insert, delete, and update operations to fail if not met.

There are three situations in which the EOClassMapping method is invoked:

1.	When an object is created by a data source, usually for insertion. values will be nil.

2.	When an object referencing this object is fetched and a fault is created. values will be the object's primary key.

3.	When a row is fetched. values will be the fetched row. Note that because of fault creation (#2, above), a class cannot rely on always receiving the complete row. To be safe, class selection should be based only on primary key values.

Class Methods

classForEntity:values:

+ (Class)classForEntity:(EOEntity *)entity values:(NSDictionary *)values

Allows a class specified by entity to substitute a different class based on it's fetched row or primary key values. See the Category Description, above, for information on when this method is called and what values represents. Note that the returned class must be either a subclass of the original class, have an entity specified in the model, or implement the entity method.